import {Map} from 'immutable'
import * as actionType from './constant'

const defaultState = Map({
    topBanners : [],
    hotRecommends : [],
    newAlbums : [],
    upList : [],
    newList : [],
    originList : [],
    settleSings: [],
})

function reducer(state = defaultState , action){
    switch(action.type){
        case actionType.CHANGE_TOP_BANNERS:
            return state.set("topBanners",action.topBanners);
        case actionType.CHANGE_HOT_RECOMMENDS:
            return state.set("hotRecommends",action.hotRecommends)
        case actionType.CHANGE_NEW_ALBUMS:
            return state.set("newAlbums",action.newAlbums)
        case actionType.CHANGE_NEW_LIST:
            return state.set("newList",action.newList)
        case actionType.CHANGE_ORIGIN_LIST:
            return state.set("originList",action.originList)
        case actionType.CHANGE_UP_LIST:
            return state.set("upList",action.upList)
        case actionType.CHANGE_SETTLE_SONGER:
            return state.set("settleSings", action.settleSings)
        default:
            return state;
    }
}

export default reducer;